package achievement;

/**
 * @Author admin
 * @Date 2019/3/20 11:21
 */
public class Undergraduate extends Student {
    Undergraduate(String name,float a,float b,float c){
        super(name);
        this.type="本科生";
        courses[0]=a;
        courses[1]=b;
        courses[2]=c;
    }
    @Override
    public String calculateGrade() {
        float sum=courses[0]+courses[1]+courses[2];
        if (sum>=90){
            return "优秀";
        }
        else if (sum>=80&sum<90) {
            return "良好";
        }
        else if (sum>=70&sum<80){
            return "中等";
        }
        else if (sum>=60&sum<70){
            return "及格";
        }
        else {
            return "不及格";
        }
    }
}
